package mvc.struts.annotation.helper;

import java.util.Properties;

import mvc.struts.annotation.entity.ConfigConstant;
import mvc.struts.annotation.util.PropsUtil;


public final class ConfigHelper {

	private static final Properties CONFIG_PROPS = PropsUtil.
			loadProps(ConfigConstant.CONFIG_FILE);
	
	
	/**
	 * 
	 * @return
	 */
	public static String getWebRootPath() {
		
		return	PropsUtil.getString(CONFIG_PROPS, ConfigConstant.WEB_ROOT,
				"");
	}
	
	/**
	 * 
	 * @return
	 */
	public static int	getServerPort() {
		
		return	PropsUtil.getInt(CONFIG_PROPS, ConfigConstant.SERVER_PORT, 80);
	}
	
	/**
	 * 
	 * @return
	 */
	public static String	getComponentScanPath() {
		
		return	PropsUtil.getString(CONFIG_PROPS, ConfigConstant.COMPONENT_SCAN);
	}
	
	/**
	 * 
	 * @return
	 */
	public static String	getJspBasePath() {
		
		return	PropsUtil.getString(CONFIG_PROPS, ConfigConstant.JSP_ROOT_PATH);
	}
}
